<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<style type="text/css">
		.father{
			width: 300px;
			height: 300px;
			background: skyblue;
		}
		.son{
			width: 100px;
			height: 100px;
			background: pink;
		}
	</style>
</head>
<body>
<div class="father">
	<div class="son"></div>
</div>
<script type="text/javascript">
	//1.事件存在三个阶段：事件捕获阶段，目标阶段，冒泡阶段
	//冒泡阶段：事件到达目标后 不会结束 而是会逐层向上冒泡传递 直到document
	let father = document.querySelector('.father')
	let son = document.querySelector('.son')
	son.onclick = function(){
		console.log('son')
	}
	father.onclick = function(){
		console.log('father')
	}
	document.querySelector('body')
</script>
</body>
</html>